<!DOCTYPE html>
<html lang="">
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <title></title>
</head>
<body>
<div id="app">
  <el-button @click="test()">测试</el-button>
  <div style="background-color: red;width: 100px;height: 100px" v-if="a[1].id==4">

  </div>
  <div style="background-color: #0067ff;width: 100px;height: 100px" v-if="a[1].id==5">

  </div>
</div>
</body>

<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
  let v = new Vue({
    el: '#app',
    data: function () {
      return {
        a:[{id:3},{id:4}]
      }
    },
    methods:{
      test() {
        v.a[1].id=5
      }
    }
  })
</script>
</html>